package com.chery.media.network.http

import com.chery.media.network.api.AppService
import com.chery.media.utils.RetrofitClient
import okhttp3.RequestBody


class AppNetWork {

    private val mService by lazy { RetrofitClient.getInstance().create(AppService::class.java) }

    /**
     * 获取版本信息
     */
    fun getVersionData(body: RequestBody) = mService.getVersionData(body)

    /**
     * 获取首页banner
     */
    fun getBannerData(body: RequestBody) = mService.getBannerData(body)

    /**
     * 获取音乐列表
     */
    fun getMusicData(body: RequestBody) = mService.getMusicData(body)

    companion object {
        @Volatile
        private var netWork: AppNetWork? = null

        fun getInstance() = netWork ?: synchronized(this) {
            netWork ?: AppNetWork().also { netWork = it }
        }
    }

}